import request from '@/utils/request'

export default {
  /*
    @param {Object} params : 查询参数
    {
      tableName:[string] - 数据表名,
      owner:[string] - 负责人OA账号,
      page:[int] - 查询页码,
      limit:[int] - 每页条数

    }
  */
  projects: (owner) => request.get('/kylin/common/projects', { params: { owner }}).then(resp => resp.data),
  cubes: (projectId, owner) => request.get('/kylin/common/cubes', { params: { projectId, owner }}).then(resp => resp.data),
  owners: (projectId, keyword) => request.get('/kylin/common/owners', { params: { projectId, keyword }}).then(resp => resp.data),
  currentUser: () => request.get('/kylin/common/currentUser').then(resp => resp.data),
  projectsExAll: (owner) => request.get('/kylin/common/projects?removeAll=true', { params: { owner }}).then(resp => resp.data),
  cubesExAll: (projectId, owner) => request.get('/kylin/common/cubes?removeAll=true', { params: { projectId, owner }}).then(resp => resp.data)
}
